<html>
<head>
 
</head>
<body style="text-align=center;font-size:24px">
<div id="problemNum" style='background-color:#999999;width:400;text-align:left;'></div>
<div id="problemContent" style='background-color:#bbbbbb;width:400;text-align:left;'></div>
<div id="result" style='color:#ffff22;font-size:48;background-color:#8855ff;width:400;'></div>
 
<script language="javascript">
    //---------------------------------//
    // Project Euler 
    //
    // Author:thrombin
    //   Date:2015-12-07
    //---------------------------------//  
var p_order=7;//Problem Order
var problem="By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13."
            +"What is the 10 001st prime number?";
//solve the problem
 
var result;
var i;
var primes=[2];
 
for(i=3;primes.length<10001;i++){
    is_prime=true;
    for(var j=0;j<primes.length;j++){
        if(i%primes[j]==0){is_prime=false;break;}
    }
    if(is_prime)primes.push(i);
     
}
result=primes.pop();
//update browser
document.getElementById("problemNum").innerHTML="Project Euler-Problem "+p_order;
document.getElementById("problemContent").innerHTML=problem;
document.getElementById("result").innerHTML="Answer:"+result;
 
</script>
</body>
</html>